const fs = require('fs-extra');
const path = require('path');

// 定义源目录和目标目录
const srcDir = path.join(__dirname, '../src');
const distDir = path.join(__dirname, '../dist');

// 要复制的文件列表
const filesToCopy = [
    'popup.html',
    'manifest.json',
    'css/popup.css',
    'assets/icons'
];

// 确保目标目录存在
fs.ensureDirSync(distDir);

// 复制文件
filesToCopy.forEach(file => {
    const src = path.join(srcDir, file);
    const dest = path.join(distDir, file);
    
    if (fs.existsSync(src)) {
        fs.copySync(src, dest);
        console.log(`Copied: ${file}`);
    } else {
        console.warn(`Warning: ${file} not found`);
    }
}); 